<template>
    <div>
          <h1>会员信息显示</h1>
          <a href="/show">返回</a>
          <br>
          <table class="table"> 
            <tbody>
                <tr>
                    <td>编号</td>
                    <td>{{ data.id }}</td>
                </tr>
                <tr>
                    <td>姓名</td>
                    <td>{{ data.name }}</td>
                </tr>
                <tr>
                    <td>电话</td>
                    <td>{{ data.phone }}</td>
                </tr>
                <tr>
                    <td>邮箱</td>
                    <td>{{ data.youxiang }}</td>
                </tr>
                <tr>
                    <td>头像</td>
                    <td>{{ data.img }}</td>
                </tr>
                <tr>
                    <td>状态</td>
                    <td>{{ data.state?'启用':'禁用' }}</td>
                </tr>
                <tr>
                    <td>性别</td>
                    <td>{{ data.sex==1?'男':'女' }}</td>
                </tr>
                <tr>
                    <td>年龄</td>
                    <td>{{ data.age }}</td>
                </tr> 
            </tbody>
          </table>
    </div>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios'
import { useRoute } from 'vue-router'

const route=useRoute();

onMounted(()=>{ 
    xq
}) 
const data=ref({
  "id": 2,
  "name": "张三",
  "phone": "18295964858",
  "youxiang": "qwe@qq.com",
  "img": "123",
  "state": true,
  "sex": 2,
  "age": 22,
  "dateMember": "2025-04-23T09:55:33.777529",
  "isDelete": true
})

const xq=()=>{
   var vid= route.query.id;
   axios.get("https://localhost:7175/api/Member/Getid",{params:{id:vid}}).then(res=>{
     data.value=res.data
   })
}
 


</script>

<style scoped>

</style>